Matching non-[a-zA-Z] characters in PHP regex

Posted by Bill X on Stack Overflow See other posts from Stack Overflow or by Bill X
Published on 2010-04-21T03:40:48Z Indexed on 2010/04/21 3:53 UTC
Read the original article Hit count: 285

Filed under:
|
|

I have some strings that need a-strippin':

ÃœT: 9.996636,76.294363

Tons of long strings of location codes. A literal regex in PHP won't match them, IE

$pattern = /ÃœT:/;
echo preg_replace($pattern, "", $row['location']);

Won't match/strip anything. (To know it's working, /T:/ does strip the last bit of that string). What's the encoding error going on here?

Alternately, I would accept a concise way to take out just the numbers.

© Stack Overflow or respective owner

Related posts about php

Related posts about regex